<?php
    include './base.php';
    $sname = $_GET["sname"];
    $sql = "select * from student inner join clazz where student.sid = clazz.cid and student.sname like '%$sname%'";
    $res = mysql_query($sql);
    $arr = array();
    while($row = mysql_fetch_assoc($res)){
        array_push($arr,$row);
    }
    print_r(json_encode($arr));
?>